Struggle the First Denotational Game

نویسنده

  • Christian Queinnec
چکیده

Games are often complex enough that new winning strategies cannot be devised without a clear and precise knowledge of the rules of the game. This situation makes games candidate to clear speciications and denotational semantics an interesting framework to specify games. This paper introduces a new game where two programs ght against each other by alteration of their code: program errors lead to death. Programs are written in a Scheme-like language with lambda, setq, prog2, if and quote special forms. Another unusual special form fork is ooered which allows to run independent threads. Programs are interpreted in a very special way with continual references to the store which acts as the ghting arena. Data are restricted to functions (closures), symbols and dotted pairs. Primitives are only car, cdr, consp, eq, rplaca and rplacd. The two lattest primitives are the weapons that can alter the code structure of the opponent, conversely they can also be used to repair its own structure. Although very simple, these capabilities must be precisely deened since they are the rules of the game. To know, for instance, the number of steps taken by the execution of some construct as well as the semantics of threads is answered by the denotational semantics of the game. The paper is probably the rst use of denotational semantics in the realm of games and as such may be viewed as an exercise in denotation. It also ooers some insights on the meaning of the data = program equation inside interpreters. Eventually it follows the Lisp tradition and ooer a worldwide arena for cleverness. The Scientiic American Journal once introduced a game Dewdney84] named Core War which simulates the ght of two programs within a commonmemory. The way to destroy its opponent was to alter the memory where lie the code and data of the two ghters in order to place erroneous instructions in the opponent code. Instructions were written in a little assembly language (Red Code) with only eight instructions for reading and writing memory cells, performing some simple arithmetics, inconditional or conditional jumps as well as forking into two threads. All addresses are PC-relative and designate words in the memory considered cyclic. Instructions and data share an uniform size: the word. This game has some aacionados and holds an annual championship. News from Core War may regularly be found in Scientiic American. Although simply summarized this game suuers from …

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Game semantics for interface

We consider an object calculus in which open terms interact with the environment through interfaces. The calculus is intended to capture the essence of contextual interactions of Middleweight Java code. Using game semantics, we provide fully abstract models for the induced notions of contextual approximation and equivalence. These are the first denotational models of this kind.

متن کامل

Game Semantics for Nominal Exceptions

We present a fully abstract denotational model for a higher-order programming language combining call-by-value evaluation and local exceptions. The model is built using nominal game semantics and is the first one to achieve both effective presentability and freedom from “bad exception” constructs.

متن کامل

From Mathematical Functions to Syntax

@article{gdp:lcf-as-pl, author={Plotkin, G. D.}, title={LCF Considered as a Programming Language}, journal={Theoretical Computer Science}, pages={223--255}, year=1977 } Summary: Plotkin investigates the relation between the denotational and the operational semantics of a programming language. As a working example, he picks PCF a language based on Scott’s Logic of Computable Functions. He demons...

متن کامل

From Mathematical Functions to Programs

@article{gdp:lcf-as-pl, author={Plotkin, G. D.}, title={LCF Considered as a Programming Language}, journal={Theoretical Computer Science}, pages={223--255}, year=1977 } Summary: Plotkin investigates the relation between the denotational and the operational semantics of a programming language. As a working example, he picks PCF a language based on Scott’s Logic of Computable Functions. He demons...

متن کامل

Kripke Open Bisimulation - A Marriage of Game Semantics and Operational Techniques

Proving that two programs are contextually equivalent is notoriously hard, particularly for functional languages with references (i.e., local states). Many operational techniques have been designed to prove such equivalences, and fully abstract denotational model, using game semantics, have been built for such languages. In this work, we marry ideas coming from trace semantics, an operational v...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1990